/*
 ============================================================================
 Name		: FbTabgroup.h
 Author	  : ceze
 Version	 : 2009/01/06 
 Copyright   : Your copyright notice
 Description : CFbTabgroup Tab组
 ============================================================================
 */

#ifndef FBTABGROUP_H
#define FBTABGROUP_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include <coecntrl.h>
#include <FbTabObserver.h>
#include <FbTabitem.h>
#include <coedef.h>


// CLASS DECLARATION
class MFbTabObserver;
class CEikLabel;

/**
 *  CFbTabgroup
 * 
 */
class CFbTabgroup : public CCoeControl
{
public:
	// Constructors and destructor

	/**
	 * Destructor.
	 */
	virtual ~CFbTabgroup( );

	/**
	 * Two-phased constructor.
	 */
	static CFbTabgroup* NewL(const TRect& aRect, CCoeControl *pParent);

	/**
	 * Two-phased constructor.
	 */
	static CFbTabgroup* NewLC(const TRect& aRect, CCoeControl *pParent);

protected:
	
	/**
	 * Constructor for performing 1st stage construction
	 */
	CFbTabgroup( );

	/**
	 * EPOC default constructor for performing 2nd stage construction
	 */
	void ConstructL(const TRect& aRect, CCoeControl *pParent);

public:
	/**
	 * From CoeControl, SizeChanged.
	 * Called by framework when the view size is changed.
	 */
	virtual void SizeChanged( );

	
	/**
	 *设置事件处理监听接口
	 */
	void SetObserver(MFbTabObserver* pObserver);
	
	/**
	 * 添加Tab项
	 */
	//virtual void AddTabL(const TInt& aTabId, const TDesC& aResFileName, const TInt& aResImageId, 
	//		const TInt& aResImageMaskId, const TInt& aResBackId, const TInt & aResTextId);
	
	/**
	 * 通过id激活tab项
	 */
	void SetActiveTabById(TInt aTabId);
	
	/**
	 * 通过序号激活tab项
	 * Hightlight (activate) a tab.
	 */
	virtual void SetActiveTabByIndexL (TInt aTabIndex);
	
	
	/**
	 * 激活的Tab id 
	 */
	 TInt GetActiveTabId() const;
	 
	 /**
	  * 激活的Tab index
	  */
	 TInt GetActiveTabIndex() const;
	 
	 /**
	  * 获取Tab项的名称
	  */
	 HBufC* GetTabTitleById(TInt aTabId);
	 
	 /**
	  * 包含的tab数
	  */
	 TInt  TabCount() const;  
	 
	 /**
	  * 通过id读取index
	  */
	 TInt GetIndexById(TInt aTabId);
	 
	  
	  /**
	   * ActiveL
	   */
	  void SetActiveL();
	  
	  /**
	  * from CCoeControl
	  */
	  void MakeVisible(TBool aVisible);
	  
	  /**
	   * set tabs dimmed
	   */
	  void SetTabsDimmed(TBool aDimmed);
	
protected:
	//
	TRect					m_rect;
	//tab切换事件通知接口
	MFbTabObserver*			m_pTabObserver;
	//Tab项数组
	CArrayPtrFlat<CFbTabitem>* 	m_pTabArray;
	//激活的tab序号
	TInt 					m_activeTabIndex;
	//隐藏Tab项
	TBool					m_isDimmedTabs;
	
	//
	//CFbTabitem				*m_pTabitem;
};


#endif // FBTABGROUP_H

